package edu.zut.cs.person;

public class Person {
    String name;
    int age;



    public String getName() {
        return name;
    }
//    //设置name的值
//    public void setName(String name) {
//        this.name = name;
//    }

    public int getAge() {
        return age;
    }

//    public void setAge(int age) {
//        this.age = age;
//    }


    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    //    设置
    public Person() {
//        name = "小张";
//        age = 18;
        this("小张",18);
    }
    void say(){
        System.out.println("say...");
    }
//    public Person(){
//        System.out.println("这是person的无参构造方法");
//    }
    public Person(int age){
        System.out.println("这是person的有参构造方法:int age");
    }
    boolean compare(Person s){
        if(this == s || this.age == s.age)
            return true;
        else
            return false;
    }

}
